package base;

import java.net.MalformedURLException;
import java.net.URL;

import org.openqa.selenium.Dimension;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.android.AndroidElement;

public class BaseDriver {
	public AndroidDriver<AndroidElement> driver  = null;
	Dimension dimension;
	String url = "http://127.0.1:4723/wd/hub";
	@BeforeClass
	public void initApp() throws MalformedURLException {
		DesiredCapabilities capabilities = new DesiredCapabilities();
        capabilities.setCapability("deviceName", "127.0.0.1:62001");
		capabilities.setCapability("platformName", "Android");
//        capabilities.setCapability("noReset", "true");
        capabilities.setCapability("appPackage", "com.cnezsoft.xxm");
        capabilities.setCapability("appActivity", ".MainActivity");
        driver = new AndroidDriver<AndroidElement>(new URL(url) , capabilities);
//        dimension=driver.manage().window().getSize();
	}
//	@AfterClass
//	public void quitApp() {
//		if(driver!=null) {
//			driver.quit();
//		}
//	}
}
